<li class="first">
    <ul class="child">
    <?php
    $listCountry = $this->listCountry;
    $num = floor(count($listCountry)/5); 
    $i=0;
    if($num == 0) $num=1;
    foreach ($listCountry as $country):?>
        <?php if($i % $num == 0 && $i!=0):?>
            </ul>
        </li>
        <li class="first">
            <ul class="child">
        <?php endif;?>
                <li><h6><a href="<?php echo $this->baseUrl('/search?c=' . $country['code'])?>"><?php echo $country['name']?></a></h6></li>
    <?php 
        $i++;
    endforeach;?>
    </ul>
</li>